home *** CD-ROM | disk | FTP | other *** search
/ Online Today 2000 January / Onto0100.iso / pc / Browser / HTML Kurse / selfhtml / zmaze3d.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-10-14  |  2.3 KB  |  78 lines

  1. import java.applet.Applet;
  2. import java.awt.BorderLayout;
  3. import java.awt.Container;
  4. import java.awt.Event;
  5. import java.awt.Panel;
  6. import java.awt.Scrollbar;
  7. import java.awt.TextField;
  8.  
  9. public class zmaze3d extends Applet {
  10.    public boolean clearUserAttempts;
  11.    public boolean hexagonalRooms;
  12.    private zmazectl zmazectl;
  13.    public zmazecan zmazecan;
  14.    public TextField message;
  15.    public boolean solutionDisplayed;
  16.    public double tilt;
  17.    private Scrollbar tiltScrollbar;
  18.  
  19.    public void init() {
  20.       this.solutionDisplayed = false;
  21.       ((Container)this).setLayout(new BorderLayout());
  22.       new Panel();
  23.       this.hexagonalRooms = false;
  24.       this.zmazecan = new zmazecan(this);
  25.       ((Container)this).add("Center", this.zmazecan);
  26.       this.zmazectl = new zmazectl(this);
  27.       ((Container)this).add("South", this.zmazectl);
  28.       this.tilt = (double)45.0F;
  29.       this.tiltScrollbar = new Scrollbar(1, (int)this.tilt, 5, 30, 60);
  30.       ((Container)this).add("East", this.tiltScrollbar);
  31.       this.message = new TextField(117);
  32.       this.message.setEditable(false);
  33.       ((Container)this).add("North", this.message);
  34.       ((Applet)this).resize(600, 350);
  35.       if (this.hexagonalRooms) {
  36.          this.message.setText("Verwenden Sie Home, Up, PgUp, Ende, Dn Pfeil, oder PgDn zum Spielen.");
  37.       } else {
  38.          this.message.setText("Verwenden Sie die Pfeiltasten zum Spielen.");
  39.       }
  40.    }
  41.  
  42.    public void start() {
  43.       this.zmazectl.enable();
  44.    }
  45.  
  46.    public void stop() {
  47.       this.zmazectl.disable();
  48.    }
  49.  
  50.    public boolean handleEvent(Event var1) {
  51.       boolean var2;
  52.       if (var1.target == this.tiltScrollbar) {
  53.          if (!this.zmazecan.p.alreadyPainting) {
  54.             if (!this.solutionDisplayed && !this.zmazecan.p.userHasSolved) {
  55.                if (this.hexagonalRooms) {
  56.                   this.message.setText("Verwenden Sie Home, Up, PgUp, Ende, Dn Pfeil, oder PgDn zum Spielen.");
  57.                } else {
  58.                   this.message.setText("Verwenden Sie die Pfeiltasten zum Spielen.");
  59.                }
  60.             } else {
  61.                this.message.setText("");
  62.             }
  63.          }
  64.  
  65.          this.tilt = (double)(90 - this.tiltScrollbar.getValue());
  66.          this.zmazecan.paint(this.zmazecan.getGraphics());
  67.          var2 = true;
  68.       } else {
  69.          var2 = false;
  70.       }
  71.  
  72.       return var2;
  73.    }
  74.  
  75.    public static void main(String[] var0) {
  76.    }
  77. }
  78.